package com.example.mooctao.util;

import androidx.lifecycle.SavedStateHandle;
import androidx.lifecycle.ViewModel;

import java.util.List;
import java.util.Map;
//存储和管理发现页面的数据
public class FindViewModel extends ViewModel {
    private final SavedStateHandle savedStateHandle;
    public FindViewModel(SavedStateHandle savedStateHandle){
        this.savedStateHandle=savedStateHandle;
    }
    public void setData1(List<Map<String, Object>> data1) {
        savedStateHandle.set("data", data1);
    }

    public List<Map<String, Object>> getData1() {
        return savedStateHandle.get("data1");
    }
    public void setData2(List<Map<String, Object>> data2) {
        savedStateHandle.set("data", data2);
    }

    public List<Map<String, Object>> getData2() {
        return savedStateHandle.get("data2");
    }
}
